package lab02.test16;
import java.util.Scanner;
public class Test16 {

    public static void main(String[] args) {

        Scanner sc=new Scanner(System.in);

        Subtraction subtraction= new Subtraction() ;

        Division division=new Division();

        Multiplication multiplication=new Multiplication();

        Addition addition=new Addition();


       System.out.println("请输入加法运算时个数");

             addition.n=sc.nextInt();

             System.out.println("请输入"+addition.n+"个数");

              for(addition.j=1;addition.j<=addition.n;addition.j++){

                      addition.a[addition.j]=sc.nextDouble();

                   }

                System.out.println("加法运算结果为"+addition.addition1());







           System.out.println("请输入被减数");

                subtraction.a[0]=sc.nextDouble();

                System.out.println("请输入减数个数");

                subtraction.n=sc.nextInt();

              System.out.println("请输入"+subtraction.n+"个减数");

              for(subtraction.j=1;subtraction.j<=subtraction.n;subtraction.j++){

                       subtraction.a[subtraction.j]=sc.nextDouble();

              }

              System.out.println("减法运算结果为"+subtraction.subtraction1());





                               System.out.println("请输入被除数");

               division.a[0]=sc.nextDouble();

              System.out.println("请输入除数个数");

               division.n=sc.nextInt();

              System.out.println("请输入"+division.n+"个除数");

              for(division.j=1;division.j<=division.n;division.j++){

                      division.a[division.j]=sc.nextDouble();

                 }

               System.out.println("除法运算结果为"+division.division1());







                                        System.out.println("请输入乘法运算时个数");

                multiplication.n=sc.nextInt();

               System.out.println("请输入"+multiplication.n+"个数");

               for(multiplication.j=1;multiplication.j<=multiplication.n;multiplication.j++){

                        multiplication.a[multiplication.j]=sc.nextDouble();

                    }

              System.out.println("乘法运算结果为："+multiplication.multiplication1());

          }

}
